﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using TransCode.Player.VideoPage;
using TransCode.Player.ImagePage;

namespace TransCode.Player
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window, IFuncChange
    {
        public MainWindow()
        {
            InitializeComponent();

            this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
        }

        void MainWindow_Loaded(object sender, RoutedEventArgs e)
        { 
            Common.MainWindow = this;
            Common.ImageMainPage = new ImageMainPage();
            Common.VideoMainPage = new VideoMainPage();
            Common.MenuButton = this.menuButton1;

            frame.NavigationUIVisibility = NavigationUIVisibility.Hidden;
            frame.Navigate(Common.ImageMainPage);
            //frame.Navigate(new VideoMainPage());
        }

        private void toolbar_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (e.Source is Grid)
                App.Current.MainWindow.DragMove();
        }

        public void Change(FuncEnum func)
        {
            switch (func)
            {
                case FuncEnum.VideoPlay:
                    frame.Navigate(Common.VideoMainPage);
                    break;
                case FuncEnum.VideoList:
                    frame.Navigate(Common.ImageMainPage);
                    break;
            }
        }
    }
}
